/***************************************************************************
 *   Antc - library                                                        *
 *                                                                         *
 *   Copyright (C) 2008 by kuerant                                         *
 *                         <kuerant@gmail.com>                             *
 *                                                                         *
 *   This library is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 *   This library is distributed in the hope that it will be usefull, but  *
 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      *
 *   Library General Public License for more details.                      *
 *                                                                         *
 *   You should have received a copy of the GNU Library General Public     *
 *   License along with this library; if not, write to the Free Software   *
 *   Foundation, Inc., 59 Temple Place - Suite 330, Boston,                *
 *   MA 02111-1307, USA                                                    *
 ***************************************************************************/


#ifndef ANTC_MESSAGE_HPP
#define ANTC_MESSAGE_HPP

#include    <string>

namespace   antc
{

class   Message
{

public  :

    std::string&    getData(void)   { return m_strData; }
    unsigned    getDataSize(void)   { return m_strData.size(); }
    void    setData(std::string& strData)   { m_strData = strData; }
    void    setData(const void* pvData, unsigned iDataSize)
    {
        const char* pszData = static_cast<const char*>(pvData);
        m_strData.assign(pszData, iDataSize);
    }
    
    std::string     serialize(void);
    void    unserialize(std::string& strData);
    void    unserialize(const void* pvData, unsigned iDataSize);
    
private :
    
    std::string     m_strData;
    
};  // class    Message
    
}   // namespace antc

#endif  // ANTC_MESSAGE_HPP
